package com.project.class8_24.proxy.transactional.service.impl;

import com.project.class8_24.proxy.transactional.bean.SellBean;
import com.project.class8_24.proxy.transactional.dao.IProductDao;
import com.project.class8_24.proxy.transactional.dao.ISellDao;
import com.project.class8_24.proxy.transactional.dao.impl.ProductDaoImpl;
import com.project.class8_24.proxy.transactional.dao.impl.SellDaoImpl;
import com.project.class8_24.proxy.transactional.service.ISellService;

public class SellServiceImpl implements ISellService {
    private IProductDao productDao = new ProductDaoImpl();
    private ISellDao sellDao = new SellDaoImpl();
    private int i = 9;
    @Override
    public void addSell(SellBean sell) {
        sellDao.add(sell);
        int i=9/0;
        productDao.upateNum(sell.getProductId(),-sell.getNum());
    }
}
